Skip to content

GH-45398: [CI][Dev][Ruby] Add Ruby lint#45417

Merged
kou merged 5 commits into
apache:mainfrom
hiroyuki-sato:topic/apply-ruby-lint
Feb 3, 2025
Merged

GH-45398: [CI][Dev][Ruby] Add Ruby lint#45417
kou merged 5 commits into
apache:mainfrom
hiroyuki-sato:topic/apply-ruby-lint

Conversation

@hiroyuki-sato

@hiroyuki-sato hiroyuki-sato commented Feb 3, 2025

Copy link
Copy Markdown
Collaborator

Rationale for this change

Multiple users are developing Ruby codes. Adding Ruby Lint helps keep the same style.

What changes are included in this PR?

Add Ruby Lint. (Rubocop)

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@hiroyuki-sato hiroyuki-sato requested a review from raulcd as a code owner February 3, 2025 03:02
@github-actions

github-actions Bot commented Feb 3, 2025

Copy link
Copy Markdown

⚠️ GitHub issue #45398 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions Bot added the awaiting review Awaiting review label Feb 3, 2025
@hiroyuki-sato

Copy link
Copy Markdown
Collaborator Author

This PR relates to Ruby. @kou Please check this too.

Comment thread .pre-commit-config.yaml Outdated
Comment thread .rubocop.yml Outdated
Comment thread .pre-commit-config.yaml Outdated
(
?^dev/tasks/homebrew-formulae/.*\.rb$|
)
files: .*\.rb$

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this part and if the line width is 90, the pre-check claims the following
As we discussed on this #45403 (comment),
we need to exclude homebrew formulae. So, I added this part.

diff --git a/dev/tasks/homebrew-formulae/apache-arrow.rb b/dev/tasks/homebrew-formulae/apache-arrow.rb
index caf82b8db..01611d17b 100644
--- a/dev/tasks/homebrew-formulae/apache-arrow.rb
+++ b/dev/tasks/homebrew-formulae/apache-arrow.rb
@@ -110,7 +110,8 @@ class ApacheArrow < Formula
         return 0;
       }
     EOS
-    system ENV.cxx, "test.cpp", "-std=c++17", "-I#{include}", "-L#{lib}", "-larrow", "-o", "test"
+    system ENV.cxx, "test.cpp", "-std=c++17", "-I#{include}", "-L#{lib}", "-larrow",
+           "-o", "test"
     system "./test"
   end
 end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev/tasks/homebrew-formulae/*.rb should be excluded by exclude not files.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar pre-commit configuration. I thought you commented exclude part. But you commented about the files part? If so, It seems OK to delete that part.

Do you mean this?

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8dcbeaece..cc46728b0 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -152,7 +152,6 @@ repos:
           (
           ?^dev/tasks/homebrew-formulae/.*\.rb$|
           )
-        files: .*\.rb$
   - repo: https://github.com/cheshirekow/cmake-format-precommit
     rev: v0.6.13
     hooks:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed files part. It seems to work well.

pre-commit run --verbose --all-files --color=always --show-diff-on-failure ruby-format
Ruby Format..............................................................Passed
- hook id: rubocop
- duration: 1.66s

Inspecting 84 files
....................................................................................

84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................

84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................

84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................

84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................

84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................

84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................

84 files inspected, no offenses detected
Inspecting 77 files
.............................................................................

77 files inspected, no offenses detected

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Feb 3, 2025
hiroyuki-sato and others added 2 commits February 3, 2025 15:06
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
@github-actions github-actions Bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels Feb 3, 2025
@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Feb 3, 2025

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou kou merged commit 6305c6e into apache:main Feb 3, 2025
@kou kou removed the awaiting change review Awaiting change review label Feb 3, 2025
@github-actions github-actions Bot added the awaiting merge Awaiting merge label Feb 3, 2025
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 6305c6e.

There were 8 benchmark results with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

@hiroyuki-sato hiroyuki-sato deleted the topic/apply-ruby-lint branch May 13, 2025 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge Awaiting merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants